/*
 * @Author: xiaxia
 * @Description: 
 * @Date: 2024-06-26 11:59:54
 * @LastEditTime: 2024-06-27 14:51:52
 * @FilePath: \project\src\api\product\trademark\index.ts
 */
import request from "@/utils/request";
import { TradeMarkRespones, TradeMark } from "./type";

// 品牌管理
enum API {
  TRADEMARK_URL = '/admin/product/baseTrademark/',
  ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
  EDITRADEMARK_URL = '/admin/product/baseTrademark/update',
  DELETERADEMARK_URL = '/admin/product/baseTrademark/remove/',
}

// 获取品牌
export const reqTrademarkList = (page:number,limit:number)=>request.get<any, TradeMarkRespones>(API.TRADEMARK_URL+`${page}/${limit}`)
//新增？修改 品牌
export const reqAddEditTrademark = (data:TradeMark)=>{
  if(data.id) { // 修改
    return request.put<any, any>(API.EDITRADEMARK_URL, data)
  } else { // 新增
    return request.post<any,any>(API.ADDTRADEMARK_URL, data)
  }
}
export const reqDeleteTrademark = (id:number) => request.delete<any, any>(API.DELETERADEMARK_URL+id)